package com.lkl.service.impl;

import com.lkl.bean.BaseResp;
import com.lkl.bean.TgStation;
import com.lkl.dao.StationDao;
import com.lkl.service.StationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author lkl
 * @Description
 * @Date 2022/3/28
 */
@Service
public class StationServiceImpl implements StationService {

    @Autowired
    StationDao stationDao;

    @Override
    public BaseResp findbyname(String name) {

        if(name==null){
            return new BaseResp(0,"请输入查询的车站名",null,null);
        }

        TgStation tgStation = stationDao.findByStationName(name);

        if(tgStation==null){

            return new BaseResp(0,"此车站不存在！",null,null);
        }
        return new BaseResp(1,"查询成功！",null,tgStation);
    }
}
